package com.reservation.dto;

import javax.validation.constraints.*;
import lombok.Data;

/**
 * 创建预定请求对象
 */
@Data
public class CreateReservationRequest {

    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @NotNull(message = "商品ID不能为空")
    private Long productId;

    @NotNull(message = "预定数量不能为空")
    @Min(value = 1, message = "预定数量必须大于0")
    private Integer quantity;

    @NotBlank(message = "联系人姓名不能为空")
    @Size(min = 2, max = 50, message = "联系人姓名长度必须在2-50个字符之间")
    private String contactName;

    @NotBlank(message = "联系电话不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String contactPhone;

    @NotBlank(message = "收货地址不能为空")
    @Size(min = 5, max = 200, message = "收货地址长度必须在5-200个字符之间")
    private String contactAddress;

    @Size(max = 500, message = "备注长度不能超过500个字符")
    private String notes;
}
